use tauri::{Builder, Wry};

use crate::application::application::invokes;

/// 注册invoke调用函数
pub fn register_invokes(app: Builder<Wry>) -> Builder<Wry> {
    app.invoke_handler(tauri::generate_handler![
        invokes::invoke_open::invoke_open,
        invokes::invoke_open_console::invoke_open_console,
        invokes::invoke_close_window::invoke_close_window,
        invokes::invoke_execute_command::invoke_execute_command,
        invokes::invoke_active_window::invoke_active_window,
        invokes::invoke_get_setting::invoke_get_setting,
        invokes::invoke_set_setting::invoke_set_setting,
        invokes::invoke_get_command_history::invoke_get_command_history,
        invokes::invoke_get_http_content::invoke_get_http_content,
        invokes::invoke_get_local_ips::invoke_get_local_ips,
        
        // 组件:V2ray
        invokes::components::v2ray::invoke_component_v2ray_info::invoke_component_v2ray_info,
        invokes::components::v2ray::invoke_component_v2ray_versions::invoke_component_v2ray_versions,
        invokes::components::v2ray::invoke_component_v2ray_install::invoke_component_v2ray_install,
        invokes::components::v2ray::invoke_component_v2ray_action::invoke_component_v2ray_action,
        invokes::components::v2ray::invoke_component_v2ray_save_basic_setting::invoke_component_v2ray_save_basic_setting,
        invokes::components::v2ray::invoke_component_v2ray_save_server::invoke_component_v2ray_save_server,
        invokes::components::v2ray::invoke_component_v2ray_save_subscription::invoke_component_v2ray_save_subscription,
        invokes::components::v2ray::invoke_component_v2ray_servers::invoke_component_v2ray_servers,
        invokes::components::v2ray::invoke_component_v2ray_subscriptions::invoke_component_v2ray_subscriptions,
        invokes::components::v2ray::invoke_component_v2ray_remove_server::invoke_component_v2ray_remove_server,
        invokes::components::v2ray::invoke_component_v2ray_remove_subscription::invoke_component_v2ray_remove_subscription,
        invokes::components::v2ray::invoke_component_v2ray_routers::invoke_component_v2ray_routers,
        invokes::components::v2ray::invoke_component_v2ray_add_router::invoke_component_v2ray_add_router,
        invokes::components::v2ray::invoke_component_v2ray_remove_router::invoke_component_v2ray_remove_router,
        invokes::components::v2ray::invoke_component_v2ray_reset_router::invoke_component_v2ray_reset_router,
        invokes::components::v2ray::invoke_component_v2ray_update_geosite::invoke_component_v2ray_update_geosite,
        invokes::components::v2ray::invoke_component_v2ray_update_subscription::invoke_component_v2ray_update_subscription,
    ])
}

